package com.abaaba.project2.bean.vo;

import com.abaaba.project2.bean.Comment;
import lombok.Data;

import java.math.BigDecimal;
import java.util.List;

@Data
public  class WxOrderDataVo {

    private Short orderStatus;
    private String orderStatusText;
    private boolean isGroupin;
    private String orderSn;
    private BigDecimal actualPrice;
    private Integer id;
    private WxHandleOption handleOption;
    private List<WxOrderGoodsInfo> goodsList;


    public void setOrderStatus(Short orderStatus) {
        this.orderStatus = orderStatus;
        if (orderStatus == 101){
            this.setOrderStatusText("未付款");
            this.handleOption = new WxHandleOption();
            this.handleOption.setCancel(true);
            this.handleOption.setPay(true);
        } else if (orderStatus == 102) {
            this.setOrderStatusText("已取消");
            this.handleOption = new WxHandleOption();
            this.handleOption.setDelete(true);
        } else if (orderStatus == 103) {
            this.setOrderStatusText("已取消(系统)");
            this.handleOption = new WxHandleOption();
            this.handleOption.setDelete(true);
        } else if (orderStatus == 201) {
            this.setOrderStatusText("已付款");
            this.handleOption = new WxHandleOption();
            this.handleOption.setRefund(true);
        }else if (orderStatus == 202) {
            this.setOrderStatusText("申请退款");
            this.handleOption = new WxHandleOption();
        } else if (orderStatus == 203) {
            this.setOrderStatusText("订单取消,退款中");
            this.handleOption = new WxHandleOption();
        } else if (orderStatus == 301) {
            this.setOrderStatusText("已发货");
            this.handleOption = new WxHandleOption();
            this.handleOption.setConfirm(true);
        } else if (orderStatus == 401){
            this.setOrderStatusText("已收货");
            this.handleOption = new WxHandleOption();
            this.handleOption.setDelete(true);
            this.handleOption.setRebuy(true);
        } else if (orderStatus == 402) {
            this.setOrderStatusText("已收货(系统)");
            this.handleOption = new WxHandleOption();
            this.handleOption.setDelete(true);
            this.handleOption.setComment(true);
            this.handleOption.setRebuy(true);
        }else if (orderStatus == 403) {
            this.setOrderStatusText("已收货");//已评价
            this.handleOption = new WxHandleOption();
            this.handleOption.setDelete(true);
            this.handleOption.setComment(false);
            this.handleOption.setRebuy(true);
        }
    }
}